package com.tij.collection;

import java.util.*;

/**
 * @ClassName:
 * @author:
 * @Description: Adding groups of elements to Collection objects
 * data:2024/10/3 16:49
 * @since
 **/
public class AddingGroups {
    public static void main(String[] args) {
        Collection<Integer> collection = new ArrayList<Integer>(Arrays.asList(1,2,3,4,5));

        Integer[] moreInts = {6,7,8,9};

        collection.addAll(Arrays.asList(moreInts));
        System.out.println("1---"+ collection);
        Collections.addAll(collection,11,12,13,14,15);
        System.out.println("2---"+ collection);

        Collections.addAll(collection,moreInts);
        System.out.println("3---"+ collection);

        List<Integer> list = Arrays.asList(16,17,18,19);
        list.set(1,99);
        System.out.println("4---"+ list);

    }
}
